﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
using CloudPms.Common.CacheProvider;
using CloudPms.Common.Utils;
using CloudPms.Domain.Interface;
using Microsoft.Practices.Unity;

namespace CloudPms.Domain.Repository
{
    public class OrderModel
    {
        public string HotelID { get; set; }

        public string OrderID { get; set; }

        public string Status { get; set; }

        public string GroupCompanyName { get; set; }

        public string GroupType { get; set; }

        public string GroupLongPacketNo { get; set; }

        public string ActivityCode { get; set; }

        public string RoomTypeID { get; set; }

        public string RoomNo { get; set; }

        public string UpgradeRoomType { get; set; }

        public string GuestSourceType { get; set; }

        public System.DateTime StartDate { get; set; }

        public System.DateTime CheckinTime { get; set; }

        public Nullable<System.DateTime> InBizDay { get; set; }

        public System.DateTime EndDate { get; set; }

        public Nullable<System.DateTime> CheckOutTime { get; set; }

        public Nullable<System.DateTime> OutBizDay { get; set; }

        public string CheckInType { get; set; }

        public int ChannelID { get; set; }

        public string MemberNo { get; set; }

        public string MemberType { get; set; }

        public string MemeberName { get; set; }

        public string GuestName { get; set; }

        public string IDCardType { get; set; }

        public string IDCardNo { get; set; }

        public string Telephone { get; set; }

        public string Memo { get; set; }

        public bool IsMaster { get; set; }

        public bool IsVIP { get; set; }

        public bool IsQuickLeave { get; set; }

        public bool IsSecret { get; set; }

        public bool IsAddPoint { get; set; }

        public bool IsValid { get; set; }

        public bool IsWakeUp { get; set; }

        public Nullable<System.DateTime> WakeUpTime { get; set; }

        public string PhoneLevelID { get; set; }

        public string SalesID { get; set; }

        public string RelateGroupID { get; set; }

        public string ResvID { get; set; }

        public System.DateTime ModifiedTime { get; set; }

        public string EmployeeID { get; set; }

        public Nullable<decimal> SpecialPrice { get; set; }

        private readonly IUnityContainer container = UnityContainerService.GetContainer();

        /// <summary>
        /// 获取渠道名称
        /// </summary>
        /// <param name="channelId"></param>
        /// <returns></returns>
        public string GetChannelName(int channelId)
        {
            if (channelId == 0) return "门店";

            //从缓存中获取
            return "渠道信息";
        }

        /// <summary>
        /// 获取客源下拉列表
        /// </summary>
        /// <returns></returns>
        public IEnumerable<SelectListItem> GetGuestSourceList()
        {
            IList<SelectListItem> items = new List<SelectListItem>();
            
            var gst = string.IsNullOrWhiteSpace(GuestSourceType)? "WI": GuestSourceType;
            
            //缓存中获取
            items.Add(new SelectListItem{Selected=gst=="WI",Text="散客",Value="WI"});
            items.Add(new SelectListItem{Selected=gst=="IM",Text="个人会员",Value="IM"});
            items.Add(new SelectListItem{Selected=gst=="CM",Text="公司会员",Value="CM"});
            items.Add(new SelectListItem{Selected=gst=="AM",Text="中介",Value="AM"});
            items.Add(new SelectListItem{Selected=gst=="GP",Text="团队",Value="GP"});
            items.Add(new SelectListItem{Selected=gst=="LP",Text="长包",Value="LP"});
            
            return items;
        }


    }
}
